export default{
    //计算总数量
    totalCount(state) {
        const a=  state.shop.cartList.reduce((pre,cur)=>{
            return pre +cur.count
        },0)
        return a
        // return state.cartLists.reduce((acc, cur) => acc + cur.count, 0)
      },
    //计算总价格
    totalPrice(state){
        const a=  state.shop.cartList.reduce((pre,cur)=>{
            return pre +cur.count*cur.price
        },0)
        return a
    }
}